<%--
  Created by IntelliJ IDEA.
  User: buf
  Date: 2018/8/10
  Time: 15:04
  等待跳转页面
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>登录成功</title>
    <%@ include file="../common/common.jsp" %>
    <style>
        #content{
            width: 800px;
            position: absolute;
            top:30%;
            left:25%;
            text-align: center;
        }
        .div-tip{
            margin: 20px;
            font-size: 20px;
        }
    </style>
</head>
<body>
<div id="content">
    <input type="hidden" value="${redirectUrl}" id="redirectUrl" />
    <div class="layui-progress layui-progress-big" lay-filter="progress">
        <div class="layui-progress-bar" lay-percent="0%"></div>
    </div>
    <div class="div-tip">
        <span>登录成功,系统将在5秒后自动跳转...</span>
    </div>
    <div class="div-tip">
        <span>如未响应,请点击下方按钮手动跳转页面</span>
    </div>
    <div class="div-tip">
        <a id="redirectBtn" style="color: lightseagreen;">立即跳转</a>
    </div>
</div>
</body>
<script>
    layui.use(['element'], function(){
        var _time = 1;
        var element = layui.element;
        var _interval = setInterval(function () {
            if (_time >= 6) {
                clearInterval(_interval);
                window.location.href = $("#redirectUrl").val();
            } else {
                var _percent = (_time * 20) + "%";
                element.progress('progress', _percent);
                _time++;
            }
        },1000);

        $("#redirectBtn").click(function () {
            window.location.href = $("#redirectUrl").val();
        });
    });
</script>
</html>
